/**   
 * @{#} DbPortNode.java Create on 2013-8-12 上午8:34:18   
 *   
 * Copyright (c) 2012 by Baidu.   
 */
package objtable.engine.xmlnode;

import objtable.engine.ExeNode;
import objtable.engine.XmlEngine;
import objtable.engine.xmlnode.gen.Dbport;
import objtable.port.DbPort;

/**
 * @author <a href="mailto:zhangbo07@baidu.com">zhangbo07</a>
 * @version 1.0
 */
public class DbPortNode extends ExeNode {
	private Dbport dbport;

	public Dbport getDbPort() {
		return dbport;
	}

	public void setDbPort(Dbport port) {
		this.dbport = port;
	}

	public void exeNode() {
		if (dbport.getId() != null
				&& XmlEngine.getObjById(dbport.getId()) == null) {
			DbPort db = new DbPort(dbport.getUrl(), dbport.getName(),
					dbport.getPassword());
			XmlEngine.putIdObj(dbport.getId(), db);
		}
	}

}
